<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <rich:panel>
        <f:facet name="header">#{messages['application.aluno.label']}</f:facet>

        <s:decorate id="numRa" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.aluno.label.ra']}</ui:define>
            #{alunoHome.instance.numRa}
        </s:decorate>

        <s:decorate id="nomAluno" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.aluno.label.nome']}</ui:define>
            #{alunoHome.instance.nomAluno}
        </s:decorate>

        <s:decorate id="numRg" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.aluno.label.rg']}</ui:define>
            #{alunoHome.instance.numRg}
        </s:decorate>

        <s:decorate id="numCpf" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.aluno.label.cpf']}</ui:define>
            #{alunoHome.instance.numCpf}
        </s:decorate>

        <s:decorate id="datNascimento" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.aluno.label.nascimento']}</ui:define>
            <h:outputText value="#{alunoHome.instance.datNascimento}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <div style="clear:both"/>
        
    </rich:panel>
    
    <div class="actionButtons">      

        <s:button view="/AlunoEdit.xhtml" 
                    id="edit" 
                 value="#{messages['application.label.edit']}"/>

        <s:button view="/#{empty alunoFrom ? 'AlunoList' : alunoFrom}.xhtml"
                    id="done"
                 value="#{messages['application.label.done']}"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab label="#{messages['application.aluno.label.falta']}">
    <div class="association" id="faltasChildren">
        
        <h:outputText value="#{messages['application.aluno.label.falta.empty']}" 
                   rendered="#{empty alunoHome.faltaItems}"/>
        
        <rich:dataTable value="#{alunoHome.faltaItems}" 
                       var="falta" 
                  rendered="#{not empty alunoHome.faltaItems}" 
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="faltasTable">
            <h:column>
                <f:facet name="header">#{messages['application.falta.label.data']}</f:facet>
                <h:outputText value="#{falta.falta.datFalta}">
                	<s:convertDateTime type="date" pattern="dd/MM/yyyy" dateStyle="short" />
                </h:outputText>
            </h:column>
            <h:column>
            	<f:facet name="header">#{messages['application.disciplina.label']}</f:facet>
            	<h:outputText value="#{falta.falta.disciplina.nomDisciplina}" />
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['application.falta.label.qtdfalta']}</f:facet>
                <h:outputText value="#{falta.numQtdFalta}"/>
            </h:column>
        </rich:dataTable>
        
    </div>
    </rich:tab>

    <rich:tab label="#{messages['application.aluno.label.alunoendereco']}">
    <div class="association" id="alunoEnderecosChildren">
        
        <h:outputText value="#{messages['application.aluno.label.alunoendereco.empty']}" 
                   rendered="#{empty alunoHome.alunoEnderecos}"/>
        
        <rich:dataTable value="#{alunoHome.alunoEnderecos}" 
                       var="alunoEndereco" 
                  rendered="#{not empty alunoHome.alunoEnderecos}" 
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="alunoEnderecosTable">
            <h:column>
                <f:facet name="header">indAluno</f:facet>
                #{alunoEndereco.id.indAluno}
            </h:column>
            <h:column>
                <f:facet name="header">indEndereco</f:facet>
                #{alunoEndereco.id.indEndereco}
            </h:column>
            <h:column>
                <f:facet name="header">indTipoEndereco</f:facet>
                <h:outputText value="#{alunoEndereco.indTipoEndereco}"/>
            </h:column>
            <h:column>
                <f:facet name="header">numEndereco</f:facet>
                <h:outputText value="#{alunoEndereco.numEndereco}"/>
            </h:column>
            <h:column>
                <f:facet name="header">desComplemento</f:facet>
                <h:outputText value="#{alunoEndereco.desComplemento}"/>
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="selectalunoEndereco" 
                     value="Select" 
                      view="/AlunoEndereco.xhtml">
                    <f:param name="alunoEnderecoIndAluno" 
                            value="#{alunoEndereco.id.indAluno}"/>
                    <f:param name="alunoEnderecoIndEndereco" 
                            value="#{alunoEndereco.id.indEndereco}"/>
                    <f:param name="alunoEnderecoFrom" value="Aluno"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    
    <div class="actionButtons">
        <s:button 
               value="Add alunoEndereco"
                view="/AlunoEnderecoEdit.xhtml">
            <f:param name="alunoIdtAluno" 
                    value="#{alunoHome.instance.idtAluno}"/>
            <f:param name="alunoEnderecoFrom" value="Aluno"/>
        </s:button>
    </div>        
    </rich:tab>

    <rich:tab label="#{messages['application.aluno.label.solicitacao']}">
    <div class="association" id="solicitacaosChildren">
        
        <h:outputText value="#{messages['application.aluno.label.solicitacao.empty']}" 
                   rendered="#{empty alunoHome.solicitacaos}"/>
        
        <rich:dataTable value="#{alunoHome.solicitacaos}" 
                       var="solicitacao" 
                  rendered="#{not empty alunoHome.solicitacaos}" 
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="solicitacaosTable">
            <h:column>
                <f:facet name="header">idtSolicitacao</f:facet>
                <h:outputText value="#{solicitacao.idtSolicitacao}"/>
            </h:column>
            <h:column>
                <f:facet name="header">datSolicitacao</f:facet>
                <h:outputText value="#{solicitacao.datSolicitacao}"/>
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="selectsolicitacao" 
                     value="Select" 
                      view="/Solicitacao.xhtml">
                    <f:param name="solicitacaoIdtSolicitacao" 
                            value="#{solicitacao.idtSolicitacao}"/>
                    <f:param name="solicitacaoFrom" value="Aluno"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    
    <div class="actionButtons">
        <s:button 
               value="Add solicitacao"
                view="/SolicitacaoEdit.xhtml">
            <f:param name="alunoIdtAluno" 
                    value="#{alunoHome.instance.idtAluno}"/>
            <f:param name="solicitacaoFrom" value="Aluno"/>
        </s:button>
    </div>        
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
